<?php

/* @var $this \yii\web\View */

/* @var $content string */

use app\widgets\Alert;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?= Html::csrfMetaTags() ?>
    <title><?= Html::encode($this->title) ?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

<div class="wrap">
    <?php
    NavBar::begin([
        'options' => [
            'class' => 'navbar-inverse navbar-fixed-top',
        ],
    ]);
    echo Nav::widget([
        'options' => ['class' => 'navbar-nav navbar-right'],
        'items'   => [
            ['label' => '测试', 'url' => ['/test/default/index']],
            ['label' => '抽象工厂', 'url' => ['/abstract-factory/default/index']],
            ['label' => '建造者', 'url' => ['/builder/default/index']],
            ['label' => '工厂方法', 'url' => ['/factory-method/default/index']],
            ['label' => '单例', 'url' => ['/singleton/default/index']],
            ['label' => '多例', 'url' => ['/multiton/default/index']],
            [
                'label' => '对象池',
                'url'   => '#',
                'items' => [
                    ['label' => '方法一', 'url' => ['/pool/default/method1']],
                    ['label' => '方法二', 'url' => ['/pool/default/method2']],
                ],
            ],
            ['label' => '原型', 'url' => ['/prototype/default/index']],
            ['label' => '简单工厂', 'url' => ['/simple-factory/default/index']],
            ['label' => '静态工厂', 'url' => ['/static-factory/default/index']],
            ['label' => '适配器', 'url' => ['/adapter/default/index']],
            ['label' => '数据映射', 'url' => ['/data-mapper/default/index']],
            ['label' => '桥梁', 'url' => ['/bridge/default/index']],
            ['label' => '组合', 'url' => ['/composite/default/index']],
            ['label' => '依赖注入', 'url' => ['/dependency-injection/default/index']],
            ['label' => '门面', 'url' => ['/facade/default/index']],
            ['label' => '流接口', 'url' => ['/fluentInterface/default/index']],
            ['label' => '享元', 'url' => ['/flyweight/default/index']],
            ['label' => '代理', 'url' => ['/proxy/default/index']],
            ['label' => '注册', 'url' => ['/registry/default/index']],
            ['label' => '责任链', 'url' => ['/responsibilitiesChain/default/index']],
            ['label' => '命令行', 'url' => ['/command/default/index']],
            ['label' => '迭代器', 'url' => ['/iterator/default/index']],
            ['label' => '中介者', 'url' => ['/mediator/default/index']],
            ['label' => '备忘录', 'url' => ['/memento/default/index']],
            ['label' => '空对象', 'url' => ['/nullObject/default/index']],
            ['label' => '观察者', 'url' => ['/observer/default/index']],
            ['label' => '规格', 'url' => ['/specification/default/index']],
            ['label' => '状态', 'url' => ['/state/default/index']],
            ['label' => '策略', 'url' => ['/strategy/default/index']],
            ['label' => '模板方法', 'url' => ['/templateMethod/default/index']],
            ['label' => '访问者', 'url' => ['/visitor/default/index']],
            ['label' => '委托', 'url' => ['/delegation/default/index']],
            ['label' => '服务定位器', 'url' => ['/serviceLocator/default/index']],
            ['label' => '资源库', 'url' => ['/repository/default/index']],
            ['label' => '实体属性值', 'url' => ['/entityAttributeValue/default/index']],
        ],
    ]);
    NavBar::end();
    ?>

    <div class="container">
        <?= Breadcrumbs::widget([
            'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
        ]) ?>
        <?= Alert::widget() ?>
        <?= $content ?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; My Company <?= date('Y') ?></p>

        <p class="pull-right"><?= Yii::powered() ?></p>
    </div>
</footer>

<?php $this->endBody() ?>
</body>
</html>
<?php $this->endPage() ?>
